//////////////////////////////////////////////////////////////////////////////
/// \file   test.cpp
/// \author Aaron Wilhelm
/// \brief  Used to test and demonstrate the library
//////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <cassert>
#include "getopts.h"

using namespace std;

GetOpts::Option cmd_types[] =
{
    { "i", "int" , GetOpts::INT}, // get an integer
    { "h", "help", GetOpts::NONE }, // get help
    { "j", "jjj" , GetOpts::NONE },
    { "d", "dou" , GetOpts::DOUBLE },
};

int main(int argc, char * * argv)
{
//    int k = 0;
    GetOpts cmd;
    bool t = cmd.set_opts(cmd_types, OptSize(cmd_types), argc, argv);

    /*
    if( cmd.is_set("i") )
    {
        k = cmd.get_int("i");
    }
    */
    if( t )
    for(unsigned int i = 0; i < OptSize(cmd_types); ++i)
    {
        cout << cmd_types[i].shrt << "  " 
             << cmd_types[i].set  << "  "
             << cmd_types[i].type << "  ";
        if( cmd_types[i].value.size() > 0 )
        {
            cout << cmd_types[i].value[0];
        }
        cout << endl;
    }

    return 0;
}
